import {_decorator, Button, Component, director} from "cc";
import {http} from "db://assets/script/common/HTTP";

const {ccclass, property} = _decorator;

@ccclass('SettingsPlane')
export class SettingsPlane extends Component {

    @property(Button)
    logoutBtn!: Button

    start() {
        this.logoutBtn.node.on(Button.EventType.CLICK, () => {
            localStorage.removeItem('uid')
            localStorage.removeItem('world-access-token')
            http.setToken('')
            http.setUid(0)
            director.loadScene('boot')
        })
    }

}